#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Datetime: 2022/9/26 11:29
# @Author  : CHENWang
# @Site    : 
# @File    : daily_get_exchange_perpetual_leverage_margin.py
# @Software: PyCharm

"""
脚本说明:
"""
import os.path

from TQR_Applications.factor_database.crypto.trading_data_update import get_exchange_perpetual_leverage_margin
from logger import logger
import traceback
from task_monitor import task_to_db, send_error_to_email
import os


if __name__ == '__main__':
    logger.info("开始get_exchange_perpetual_leverage_margin")
    task_to_db(os.path.basename(__file__), 'get_exchange_perpetual_leverage_margin')
    try:
        get_exchange_perpetual_leverage_margin()
    except Exception as e:
        msg = traceback.format_exc()
        logger.info(msg)
        send_error_to_email(script_name=os.path.basename(__file__), func_name="get_exchange_perpetual_leverage_margin", message=msg)
        raise e
    task_to_db(os.path.basename(__file__), 'get_exchange_perpetual_leverage_margin', 1)
    logger.info("成功get_exchange_perpetual_leverage_margin")